using System;
using System.Collections.Generic;
using System.Text;
using QLKS.HeThongBUS;
using QLKS.HeThongDAO;
using System.Data;


namespace QLKS.HeThongBUS
{
    public enum LoaiKH_BUSResult
    {
        OK,
        DAOERROR,
    }

    public enum KH_BUSResult
    {
        OK,
        DAOERROR,
    }


    public class KH_BUS
    {


        public static DataTable DSLoaiKH()
        {
            return KH_DAO.SelectAllLoaip();
        }

        public static LoaiKH_BUSResult ThemLKH(KH_DTO lkh)
        {
            if (!KH_DAO.Insert(lkh))
                return LoaiKH_BUSResult.DAOERROR;
            return LoaiKH_BUSResult.OK;
        }

        public static LoaiKH_BUSResult UpdateLKH(KH_DTO lkh)
        {
            if (!KH_DAO.Update(lkh))
                return LoaiKH_BUSResult.DAOERROR;
            return LoaiKH_BUSResult.OK;
        }

        public static LoaiKH_BUSResult DeleteLKH(KH_DTO lkh)
        {
            if(!KH_DAO.Delete(lkh))
                return LoaiKH_BUSResult.DAOERROR;
            return LoaiKH_BUSResult.OK;
        }

        //khach hang



        public static DataTable DSKH()
        {
            return KH_DAO.SelectAllKH();
        }

        public static KH_BUSResult ThemKH(KH_DTO kh)
        {
            if (!KH_DAO.InsertKH(kh))
                return KH_BUSResult.DAOERROR;
            return KH_BUSResult.OK;
        }

        public static KH_BUSResult UpdateKH(KH_DTO kh)
        {
            if (!KH_DAO.UpdateKH(kh))
                return KH_BUSResult.DAOERROR;
            return KH_BUSResult.OK;
        }

        public static KH_BUSResult DeleteKH(KH_DTO kh)
        {
            if (!KH_DAO.DeleteKH(kh))
                return KH_BUSResult.DAOERROR;
            return KH_BUSResult.OK;
        }

        //danh sach phong
        public static DataTable DSPhong()
        {
            return KH_DAO.Danhsachphong();
        }

        //danh sach loai khach hang them vao combobox
        public static DataTable cbbdslkh()
        {
            return KH_DAO.Dsloaikh();
        }



    }
}
